@extends('admin::layouts.master')
@section('title')
    积分订单详情
@endsection
<style>
</style>
@section('tab')
    <div style="padding: 20px; background-color: #F2F2F2; ">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md6">
                <div class="layui-card">
                    <div class="layui-card-header">用户信息</div>
                    <div class="layui-card-body" >
                        会员头像：<img src="{{$data['user_info']['head_img']['full_src']}}" style="width: 80px; height: 80px;" /><br>
                        会员名称：{{$data['user_info']['username']}} <br>
                        真实姓名：{{$data['user_info']['realname']}}<br>
                        会员昵称：{{$data['user_info']['nickname']}}<br>
                        会员等级：{{$data['user_info']['level_name']}}<br>
                        实时积分：{{$data['user_info']['integral']}}<br>
                        消费积分：{{$data['user_info']['use_integral']}}<br>
                        累计积分：{{$data['user_info']['integral_all']}}<br>
                        会员性别：{{$data['user_info']['sex']==1?'男':'女'}}<br>
                        手机号码：{{$data['user_info']['phone']}}<br>
                        电子邮箱：{{$data['user_info']['email']}}<br>
                        会员生日：{{$data['user_info']['birthday']}}<br>
                        注册时间：{{$data['user_info']['created_at']}}<br>
                        账户状态：{{$data['user_info']['status']==1?'正常':'禁用'}}<br>
                    </div>
                </div>
            </div>

            <div class="layui-col-md6" >
                <div class="layui-card">
                    <div class="layui-card-header">积分明细</div>
                    <table class="layui-hide" id="test"></table>
                </div>
            </div>

            <div class="layui-col-md6" >
                <div class="layui-card">
                    <div class="layui-card-header">积分订单列表</div>
                    <table class="layui-hide" id="test2"></table>
                </div>
            </div>

            <div class="layui-col-md6" >
                <div class="layui-card">
                    <div class="layui-card-header">服务订单列表[已支付]</div>
                    <table class="layui-hide" id="test3"></table>
                </div>
            </div>

            <div class="layui-col-md6" >
                <div class="layui-card">
                    <div class="layui-card-header">预约订单列表</div>
                    <table class="layui-hide" id="test4"></table>
                </div>
            </div>

            <div class="layui-col-md6" >
                <div class="layui-card">
                    <div class="layui-card-header">优惠券列表</div>
                    <table class="layui-hide" id="test5"></table>
                </div>
            </div>

            <div class="layui-col-md6" >
                <div class="layui-card">
                    <div class="layui-card-header">车辆列表</div>
                    <table class="layui-hide" id="test6"></table>
                </div>
            </div>



        </div>
    </div>

@endsection

@section('tab_js')
    <script>
        layui.use(['form', 'layer', 'jquery','table'], function () {
            $ = layui.jquery;
             var form = layui.form,
                 layer = layui.layer,
                 table = layui.table;
                 table.render({
                     elem: '#test'
                     ,url:'{{route("admin_user_detail_list",["user_id"=>$data["user_info"]["id"]])}}'
                     ,height: 400
                     ,cols: [[
                       ,{field:'id',  title: 'ID', sort: true, fixed: 'left'}
                       ,{field:'nickname',  title: '用户名'}
                       ,{field:'type_msg',  title: '类型'}
                       ,{field:'deduct',  title: '操作积分'}
                       ,{field:'surplus',  title: '剩余积分'}
                       ,{field:'remarks', title: '备注'}
                       ,{field:'created_at', title: '操作时间'}
                     ]]
                     ,page: true
                 });

                // table.render({
                //     elem: '#test2'
                //     ,url:'{{route("admin_integral_order_list",["user_id"=>$data["user_info"]["id"]])}}'
                //     ,height: 400
                //     ,cols: [[
                //       ,{field:'id',  title: 'ID', sort: true, fixed: 'left'}
                //       ,{field:'order_no',  title: '订单号'}
                //       ,{field:'status_msg',  title: '订单状态'}
                //       ,{field:'pay_status_msg',  title: '支付状态'}
                //       ,{field:'pay_time',  title: '支付时间'}
                //       ,{field:'order_integral',  title: '订单积分'}
                //       ,{field:'goods_name',  title: '商品名称'}
                //       ,{field:'address_name',  title: '收货人'}
                //       ,{field:'address_phone',  title: '收货电话'}
                //       ,{field:'address_info',  title: '收货地址'}
                //       ,{field:'created_at',  title: '下单时间'}
                //     ]]
                //     ,page: true
                // });

                // table.render({
                //     elem: '#test3'
                //     ,url:'{{route("admin_repairstore_order_list",["user_id"=>$data["user_info"]["id"]])}}'
                //     ,height: 400
                //     ,cols: [[
                //       ,{field:'id',  title: 'ID', sort: true, fixed: 'left'}
                //       ,{field:'order_number',  title: '订单号'}
                //       ,{field:'goods_name',  title: '商品名称'}
                //       ,{field:'goods_num',  title: '商品数量'}
                //       ,{field:'pay_status',  title: '支付状态'}
                //       ,{field:'status',  title: '订单状态'}
                //       ,{field:'order_price',  title: '商品金额'}
                //       ,{field:'pay_price',  title: '实付金额'}
                //       ,{field:'coupon_price',  title: '优惠金额'}
                //       ,{field:'refund_price',  title: '退款金额'}
                //       ,{field:'refund_cause',  title: '退款说明'}
                //       ,{field:'created_at',  title: '下单时间'}
                //     ]]
                //     ,page: true
                // });

                 table.render({
                    elem: '#test4'
                    ,url:'{{route("admin_checkpoint_order_list",["user_id"=>$data["user_info"]["id"]])}}'
                    ,height: 400
                    ,cols: [[
                      ,{field:'id',  title: 'ID', sort: true, fixed: 'left'}
                      ,{field:'order_sn',  title: '订单号'}
                      ,{field:'appointment_num',  title: '商品数量'}
                      ,{field:'pay_state',  title: '支付状态'}
                      ,{field:'order_state',  title: '订单状态'}
                      ,{field:'appointment_state',  title: '检测状态'}
                      ,{field:'price',  title: '订单金额'}
                      ,{field:'refund_price',  title: '退款金额'}
                      ,{field:'refund_cause',  title: '退款说明'}
                      ,{field:'plate_no',  title: '车牌号'}
                      ,{field:'created_at',  title: '预约时间'}
                    ]]
                    ,page: true
                });


                table.render({
                    elem: '#test5'
                    ,url:'{{route("admin_user_coupon_list",["user_id"=>$data["user_info"]["id"]])}}'
                    ,height: 400
                    ,cols: [[
                      ,{field:'id',  title: 'ID', sort: true, fixed: 'left'}
                      ,{field:'ticket_num',  title: '券号'}
                      ,{field:'pid_msg',  title: '类型'}
                      ,{field:'name',  title: '名称'}
                      ,{field:'coupon_msg',  title: '说明'}
                      ,{field:'updated_at',  title: '领取时间'}
                      ,{field:'over_at',  title: '到期时间'}
                      ,{field:'status',  title: '状态'}
                    ]]
                    ,page: true
                });

                table.render({
                    elem: '#test6'
                    ,url:'{{route("admin_user_vehicle_list",["user_id"=>$data["user_info"]["id"]])}}'
                    ,height: 400
                    ,cols: [[
                        ,{field:'id',  title: 'ID', sort: true, fixed: 'left'}
                        ,{field:'pinpai',  title: '品牌'}
                        ,{field:'name',  title: '型号'}
                        ,{field:'plate_no',  title: '车牌号'}
                    ]]
                    ,page: true
                });

        })
       </script>
@endsection      
